﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using App.Views.ViewModels;

namespace App.Models
{
    public class Utils
    {
        //分页参数
        public static int PAGE_SIZE { 
            get {
                try
                {
                    string pz = ConfigurationManager.AppSettings["PageSize"];
                    return int.Parse(pz);
                }
                catch {
                    return 15;
                }
            } 
        }
        private static string GetAppSetting(string serviceName,string def){
            try{
                return ConfigurationManager.AppSettings[serviceName];
            }catch{
                return def;
            }
        }
        public static string VEHICLE_SERVICE_TYPE{         //用车服务        
            get
            {
                return GetAppSetting("用车服务","0100");
            }
        }
        public static string REFRI_SERVICE_TYPE{      //冷藏服务
            get
            {
                return GetAppSetting("冷藏服务","0200");
            }
        }
        public static string COSMETIC_SERVICE_TYPE{      //整理服务
            get
            {
                return GetAppSetting("整理服务", "0300");
            }
        }
        public static string WAKE_SERVICE_TYPE{          //守灵服务
            get
            {
                return GetAppSetting("守灵服务", "0400");
            }
        }
        public static string FAREWELL_SERVICE_TYPE{      //告别服务
            get
            {
                return GetAppSetting("告别服务", "0500");
            }
        }
        public static string CREMATION_SERVICE_TYPE{  //火化服务
            get
            {
                return GetAppSetting("火化服务", "0600");
            }
        }
        public static string DEPOSIT_SERVICE_TYPE{      //寄存服务        
            get
            {
                return GetAppSetting("寄存服务", "0700");
            }
        }
        public static string GOODS_SERVICE_TYPE{        //葬品服务
            get
            {
                return GetAppSetting("葬品服务", "0800");
            }
        }
        public static string OTHER_SERVICE_TYPE{         //其他服务
            get
            {
                return GetAppSetting("其他服务", "0900");
            }
        }

        public static string DRIVER_DEPARTMENT                  //司机所在的部门名称
        {
            get { return GetAppSetting("DRVDEPT","汽车班");}
        }
        public static string COSMETIC_DEPARTMENT                //整容师所在的部门名称
        {
            get { return GetAppSetting("COSMTICDEPT", "业务班"); }
        } 
    }
}